package cn.opopopo.design_pattern_learn.创建型.factory_method;

// 5. 测试类
public class FactoryMethodDemo {
    public static void main(String[] args) {
        AnimalFactory factory1 = new DogFactory();
        factory1.getAnimalAndMakeSound(); // 输出: Woof!

        AnimalFactory factory2 = new CatFactory();
        factory2.getAnimalAndMakeSound(); // 输出: Meow!
    }
}